<template>
	<view class="container" :class="[{ active: isActive }]">
		<text class="tab-item-title" :class="[{ active: isActive }]" :style="{
			'height': height,
			'line-height': height,
			'font-size': fontSize,
			'font-weight': fontWeight,
			'color': color
		}">{{tab[props.nameField] || tab}}</text>
		<view class="sort-box" v-if="tab['sort']">
			<dyc-icons type="triangle" fontSize="5px" :color="(isActive&&tab.sortType == 1)?color:'#CCCCCC'"></dyc-icons>
			<view class="" style="height: 2px;"></view>
			<dyc-icons type="inverted-triangle" fontSize="5px" :color="(isActive&&tab.sortType == 2)?color:'#CCCCCC'"></dyc-icons>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			tab: {
				type: [String, Number, Object, Array, Boolean],
				default: ()=>{ return {} }
			},
			height: {
				type: [String, Number],
			},
			fontSize: {
				type: [String, Number],
			},
			fontWeight: {
				type: [String, Number],
			},
			color: {
				type: String,
			},
			props: {
				type: Object,
				default: ()=>{ return {  } }
			},
			type: {
				type: String,
			},
			isActive: {
				type: Boolean
			}
		}
	}
</script>

<style scoped>
	.container {
		position: relative;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		/* #ifndef APP-NVUE */
		display: flex;
		height: 100%;
		width: 100%;
		/* #endif */
		/* #ifdef APP-NVUE */
		flex: 1;
		/* #endif */
		border-radius: 10rpx;
	}
	.active {
		/* background-color: #BC9D6F; */
	}
	.tab-item-title {
		flex-wrap: nowrap;
		/* #ifndef APP-PLUS */
		white-space: nowrap;
		z-index: 0;
		/* #endif */
	}
	.active{
		/* transform: scale(1.2); */
	}
	
	.sort-box{
		margin-left: 7px;
		display: flex;
		flex-direction: column;
	}
</style>
